package com.medicine.hbp.adapter;

import org.kymjs.kjframe.KJBitmap;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.medicine.hbp.base.MyBaseAdapter;
import com.medicine.hbp.mob.findByListApplyVo;
import com.medicine.hbp.R;

public class WonderfulAppAdapter extends MyBaseAdapter {
	private LayoutInflater inflater;
	KJBitmap bitmap = new KJBitmap();

	public WonderfulAppAdapter(Activity activity) {
		this.activity = activity;
		inflater = LayoutInflater.from(activity);
	}

	@Override
	public View getView(int position, View view, ViewGroup arg2) {
		ViewHolder holder;
		if (view == null) {
			holder = new ViewHolder();
			view = inflater.inflate(R.layout.item_wonderfulapp, arg2, false);
			holder.img_applyphoto = (ImageView) view.findViewById(R.id.img_applyphoto);
			holder.txt_applytitle = (TextView) view.findViewById(R.id.txt_applytitle);
			holder.txt_applynote = (TextView) view.findViewById(R.id.txt_applynote);
			view.setTag(holder);
		} else {
			holder = (ViewHolder) view.getTag();
		}
		findByListApplyVo vo = (findByListApplyVo) getItem(position);
		if (vo != null) {
			holder.txt_applytitle.setText(vo.applyTitle);
			holder.txt_applynote.setText(vo.applyNote);
			bitmap.display(holder.img_applyphoto, vo.applyPhoto);
		}
		return view;
	}

	class ViewHolder {
		TextView txt_applytitle;
		TextView txt_applynote;
		ImageView img_applyphoto;
	}
}
